package io.renren.modules.generator.controller;

import com.entites.DeviceSet;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;




/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-12-09 13:25:42
 */
@RestController
@RequestMapping("/generator/devicelist")
public class DevicelistController {


    @Resource
    private RestTemplate restTemplate;
    @Value("${service-url.nacos-user-service}")
    private String URL;

    /**
     * 列表
     */


    @GetMapping("/sys/listt")
    public List<DeviceSet> getDeviceSet(){

        return restTemplate.getForObject(URL+"/TransFormers", ArrayList.class);

    }

    @GetMapping("/sys/tree")
    public Object getTree(){


        return restTemplate.getForObject("https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples/data/asset/data/flare.json",Object.class);
    }




}









/**
 *
 *
 *
 * */



